/**
 * Created by henian.xu on 2017/7/17.
 *
 */

import Qs from 'qs';

export default {
    url: '/',
    baseURL: '',
    method: 'GET',
    transformRequest: [
        (data) => {
            data = Qs.stringify(data, {
                arrayFormat: 'repeat',
                serializeDate: d => d.getTime(),
            });
            return data;
        },
    ],
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        // 'token': '',
    },
    params: {},
    paramsSerializer: function(params) {
        return Qs.stringify(params, {
            arrayFormat: 'repeat',
            serializeDate: d => d.getTime(),
        });
    },
    data: {},
    timeout: 30000,
    withCredentials: false,
    responseType: 'json',
    maxContentLength: 2000,
    validateStatus: function(status) {
        return status >= 200 && status < 300; // default
    },
    maxRedirects: 5,
};
